<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta charset="utf-8">
<link rel="stylesheet" href="{MODULE_URL}resource/css/style.css" />
{if $color!=""}
<link rel="stylesheet" href="{MODULE_URL}resource/css/{$color}.css" />
{/if}
<script type="text/javascript" src="{MODULE_URL}resource/js/jquery-2.1.4.min.js" ></script>
<title>{$huodongname}</title>
{php echo register_jssdk();}
<script type="text/javascript">
var ua = navigator.userAgent.toLowerCase();
var isWeixin = ua.indexOf('micromessenger') != -1;
var isAndroid = ua.indexOf('android') != -1;
var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);
if (!isWeixin) {
    document.head.innerHTML = '<title>抱歉，出错了</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"><link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/0.4.1/weui.css">';
    document.body.innerHTML = '<div class="weui_msg"><div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div><div class="weui_text_area"><h4 class="weui_msg_title">请在微信客户端打开链接</h4></div></div>';
}
</script>
</head>
<body>
<div class="home">
	
	<!--logo-->
	<div class="logo clearfix"><a href="{$qylink}" style="background-image:url({$_W['attachurl']}{$qylogo});">{$qyname}</a></div>
	
	<div class="my"><a href="#" onclick="seeme()"><i class="iconfont">&#xe600;</i> 我的</a><a href="{php echo $this->createMobileUrl('ranking',array('rid'=>$rid));}"><i class="iconfont">&#xe602;</i> 排行榜</a></div>
	
	
	
	<!--tongji-->
	<div class="counts">
		<span>{$count}人参与</span>
	</div>
	<!--btn-->
	<div class="play">
		<a href="#" onclick="startto()"><i class="count">{$shyucount}</i></a>
	</div>
	
	<!--rule-->
	<div class="rule">
		<span><i class="iconfont">&#xe601;</i> 活动规则</span>
	</div>
</div>

<!--问答提示 start-->
<div class="result" id="nocount" style="display:none;">
	<div class="box">
		<div class="close fr"><i class="iconfont">&#xe606;</i></div>
		<div class="txt"><p><i class="iconfont">&#xe607;</i></p><p>您没有答题的机会了</p>{if $isshareadd==1}{if $is_max==0}<p>每邀请一个好友答题，可以增加一次答题机会</p>{else}<p>您的分享次数已用完，谢谢您参与答题</p>{/if}{/if}</div>
		<div class="btn">
			<ul class="flex">
				<li><a href="{php echo $this->createMobileUrl('ranking',array('rid'=>$rid));}"><i class="iconfont">&#xe602;</i> 排行榜</a></li>
				<li><a href="javaScript:;" class="red share"><i class="iconfont">&#xe605;</i>呼唤朋友</a></li>
			</ul>
		</div>
	</div>
</div>
<!--问答提示 end-->
<!--share-->
<div class="tips"><img src="{MODULE_URL}resource/images/guide.gif" width="100%"></div>


<!--活动介绍 start-->
<div class="popup" style="display:none ;">
	<div class="pcontent">
		<div class="tit f16">
			<div class="close fr"><i class="iconfont">&#xe606;</i></div>
			<h2 class="f16">活动介绍</h2>
		</div>
		<div class="txtBox">
		   <p>{$huodongdesc}</p>
		</div>
	</div>
</div>

<!--活动介绍 end-->

<script>
$(document).ready(function(){
	//活动介绍
	$(".rule").click(function(){
		$(".popup").show(0);
	})
	$(".popup .close").click(function(){
		$(".popup").hide(0);
	})
	$(".share,.tips").click(function(){
		$(".tips").toggle(0);
	})
	
	$(".close").click(function(){
		$(this).closest(".result").hide(0);
	})
})
function startto(){
	if(parseInt({$shyucount})==0){
		$("#nocount").show();
	}else{
		if(confirm("开始答题后将使用一次机会，答题中切勿退出，确定要开始答题吗？")){
			var url="{php echo $this->createMobileUrl('dati')}";
			var rid='{$rid}';
			var fromid='{$fromid}';
			location.href=url+"&rid="+rid+"&fromid="+fromid;
		}
	}
}

function seeme(){
	var rid='{$rid}';
	var url="{php echo $this->createMobileUrl('chengji')}";
	location.href=url+"&rid="+rid+"&nocount=1";
}

wx.ready(function(){
   sharedata = {
       title: "{$sharetitle} ",
       desc: "{$sharecontent}",
       link: "{$sharelink}",
       imgUrl: "{$shareimg}"
	}; 
	wx.onMenuShareAppMessage(sharedata);//分享给朋友
	wx.onMenuShareTimeline(sharedata);//分享到朋友圈
	wx.showOptionMenu();//显示右上角按钮
});
</script>
</body>
</html>
